<div id="wants-grid">
	<span class="page-heading">Wants</span><br />
	<div id="wants-container">
		<div id="wants-search">
		<?php
			echo form_label('Filter: ', 'filter', array('class' => 'normal-text')) . '&nbsp&nbsp';
				$option = array(
					'all'			=> "All Wants",
					'everyoneelse' => "Others' Wants",
					'mine' => 'My Wants',
				);	
			echo form_dropdown('filter', $option, 'all', 'id = "filter" onChange="submitsearch()"') . ' &nbsp&nbsp&nbsp&nbsp';
			
			echo form_label('Category: ', 'category', array('class' => 'normal-text')) . ' &nbsp&nbsp';
				$option = array(0 => "Any");
				foreach ($categories as $cat) {
							$option[$cat['category_id']] = $cat['category_name'];
				}			
			echo form_dropdown('category_id', $option, isset($selectedcat)?$selectedcat:0, 'id = "category_id" class="normal-text" onChange="submitsearch()"') . '<br />';
			
			echo form_label("Search: ", "searchfield", array('class' => 'normal-text')) . ' &nbsp&nbsp';
			$attribute = array(
				'name'		=> 'searchfield',
				'id' 		=> 'searchfield',
				'size' 		=> '45',
				'placeholder' 	=> isset($_POST['search'])?$_POST['search']:'Search',
				'onKeyup'  => 'submitsearch()',
				'class' => 'normal-text',
			);
			echo form_input($attribute);
			
			echo '&nbsp&nbsp';
			echo '<div id="search-button"><a href="Javascript:void(0);" onclick = "submitsearch()" ></a></div><br />';
		?>
		</div>
		<div class="horizontal-bar"></div>
		<span class="page-subheading">The Wants Board</span> &nbsp&nbsp <span class="small-text">Wants will be removed from the board after a 2 week period.</span><br />
		<div id="wants-border">
			<div id="wants-results">
			</div>
			<div id="paginator">
			</div>
		</div>
	</div>
	<div class="horizontal-bar"></div>
	<div id="wants-input">
	<span class="page-subheading">I Want...</span><br />
		<div id="wants-form">
		<?php
			echo form_label('Category: ', 'category', array('class' => 'normal-text')) . '&nbsp&nbsp';
				$option = array();
				foreach ($categories as $cat) {
							$option[$cat['category_id']] = $cat['category_name'];
				}
				echo form_dropdown('input_category_id', $option, 0, 'id = "input_category_id" class="normal-text"') . '<br />';
				
				echo form_label("Description: ", "textfield", array('class' => 'normal-text')) . '<br />';
				$attribute = array(
					'name'		=> 'textfield',
					'id' 		=> 'textfield',
					'placeholder' 	=> 'Enter Description',
					'class' => 'normal-text',
				);
				echo form_textarea($attribute) . '<br />';
				echo '<div id="submit-button"><a href="Javascript:void(0);" onclick = "submitwant()" ></a></div><br />';
		?>
		</div>
	</div>
</div>
<div style="height: 30px"></div>


<?php
	$json = json_encode($searchresult);
	$json2 = json_encode($option);
	echo '<script type="text/javascript">var searchresults = ' . $json . ';</script>';
	echo '<script type="text/javascript">var categories = ' . $json2 . ';</script>';
	echo '<script type="text/javascript">var base_url = "' . base_url() . '";</script>';
	echo '<script type="text/javascript">var current_user = "' . $fb_id . '";</script>';

?>